export {};

// 交叉 & 的type定义的对象类型
type Person = {
  name: string;
  age: number;
  sayHi(): void;
};

// 复用了 Person 对象类型，通过 “&”
type Student = Person & {
  score: number;
};

let stu: Student = {
  name: 'Jack',
  age: 18,
  sayHi: () => console.log('hello'),
  score: 100,
};
